<?php
/**
 * @var \Ke\Web\Web     $web
 * @var \Ke\Web\Context $this
 */

$trace = $trace ?? [];
$i = count($trace);

if (empty($trace))
	return '';
?>
<address><?php print $file . '#' . $line; ?></address>
<table border="1" cellpadding="2" style="border-collapse: collapse;">
	<thead>
	<tr>
		<th>File</th>
		<th>Line</th>
		<th>Function</th>
	</tr>
	</thead>
	<tbody>
	<?php
	foreach ($trace as $index => $data) {
		?>
		<tr>
			<td>
				<address><?php print $data['file'] ?? '' ?></address>
			</td>
			<td><?php print $data['line'] ?? '' ?></td>
			<td>
				<code>
					<?php
					if (!empty($data['class']) && !empty($data['type']) && !empty($data['function'])) {
						printf('%s%s%s()', $data['class'], $data['type'], $data['function']);
					}
					?>
				</code>
			</td>
		</tr>
		<?php
	}
	?>
	</tbody>
</table>
